<template>
  <div class="index-page">
    <!--头部导航栏-->
    <div class="nav-header">
      <div class="nav-bar">
        <index-nav-bar/>
      </div>
    </div>
    <!--页面主体-->
    <div class="content-box">
      <router-view/>
    </div>
    <el-backtop class="back-to-top" :right="100" :bottom="100"/>
  </div>
</template>
<script>
import {pongService} from "@/service/auth";
import {Message} from "@/utils/Message";
import IndexNavBar from "@/components/index/IndexNavBar.vue";
import router from "@/router";

export default {
  name: "index-page",
  components: {IndexNavBar},
  setup() {
    const pong = () => {
      pongService().then(res => {
        Message.success(res.data.msg);
      });
    };

    // router.push({name:"list"})
    return {
      pong
    };
  }
};
</script>

<style scoped>
/*不想写几套多端适配样式，搞个简单的就好了*/
@media screen  and (max-width: 1100px) {

  .back-to-top {
    display: none;
  }

  .content-box {
    margin: 1rem auto 0 auto!important;
  }
}

.index-page {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.nav-header {
  position: relative;
  height: 5rem;
}

.nav-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  z-index: 250;
  background: white;
  border-bottom: 1px solid #dcdfe6
}

.content-box {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 5rem auto 0;
  max-width: 1000px;
  min-width: 200px;
}

:deep(.el-header) {
  --el-header-padding: 0 0px;
}
</style>